

package metadatabrowser;

import at.fhj.util.Pair;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.swt.graphics.Image;

/**
 *
 * @author Seuchter
 */
public class TableTableLabelProvider implements ITableLabelProvider{

    private static final int COL_NAME = 1;
    private static final int COL_VALUE = 2;


    @Override
    public Image getColumnImage(Object o, int i)
    {
        return null;
    }

    @Override
    public String getColumnText(Object o, int i)
    {
        if(! (o instanceof Pair))
        {
            return "!!!ERROR!!!";
        }

        Pair<String,String> p = (Pair<String, String>) o;

        if(i == COL_NAME)
        {
            return p.getFirst();
        }
        else if(i == COL_VALUE)
        {
            return p.getSecond();
        }

        return "!!!ERROR!!!";



    }

    @Override
    public void addListener(ILabelProviderListener il)
    {

    }

    @Override
    public void dispose()
    {
        
    }

    @Override
    public boolean isLabelProperty(Object o, String string)
    {
        return false;
    }

    @Override
    public void removeListener(ILabelProviderListener il)
    {

    }

}
